<?php


namespace app\common\model;


use app\lib\exception\MysqlErrorException;
use think\Exception;
use think\facade\Request;
use think\Model;

class Error extends Model
{

    public static function addErrorLog($data,$e = null)
    {
        $data['url'] = Request::url(true);
        $data['add_time'] = now_time();
//        $data['remarks'] = $e->getMessage();
        try{
            self::create($data);
        }catch (Exception $exception){
            throw new MysqlErrorException();
        }
    }
}